$dir = "/data4/bsi/refdata/FASTA/Homo_sapiens.UCSC_HG19/";
$targetdir = "/data1/bsi/BORA_processing/devel/genome_simulator/fake_dir";
$number_of_lines=30;
$str = `ls $dir`;
@str = split("\n",$str);
#print "@str\n";
mkdir "$targetdir", unless -d "$targetdir";
for($i=0;$i<@str;$i++)
{
	if($str[$i] =~ m/^chr/)
	{
		$file = "$dir/$str[$i]";
		open BUFF,"$file" or die "no file exists $file\n";
		open WRBUFF,">$targetdir/$str[$i]" or die "unable to create file $str[$i]\n";
		$line=<BUFF>;
		print WRBUFF $line;
		$k =0;
		while($k <30)
		{
        		$line=<BUFF>;
        		if($line !~ m/^N/)
        		{
				print WRBUFF $line;
                		$k++;
        		}
		}
	}
		
	
}


